import {createRouter, createWebHistory} from 'vue-router'

import home from '../views/home/home.vue'
import user from '../views/system/user.vue'
import operlog from '../views/system/log/operlog.vue'
import logininfor from '../views/system/log/logininfor.vue'
import online from '../views/monitor/online.vue'
import cacheList from '../views/monitor/cacheList.vue'
import login from '../views/login/login.vue'
import Layout from '../components/Layout/Layout.vue'
const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [

        {
            path: '/login', component: login
        },
        {
            path: '/redirect', component: Layout,children:[
                {
                    path: '/', component: home,meta: {
                        title: '首页'
                    }
                },

                {
                    path: '/system',
                    meta: {
                        title: '系统管理'
                    },
                    children: [
                        {
                            path: '/user', component: user, meta: {
                                title: '用户管理'
                            }
                        },
                        {
                            path: '/log', meta: {
                                title: '日志管理'
                            }, children: [
                                {
                                    path: '/operlog', component: operlog, meta: {
                                        title: '操作日志'
                                    }
                                },
                                {
                                    path: '/logininfor', component: logininfor, meta: {
                                        title: '登入日志'
                                    }
                                },
                            ]
                        },
                    ]
                },

                {
                    path: '/monitor',meta: {
                        title: '系统监控'
                    }, children: [
                        {
                            path: '/online', component:online , meta: {
                                title: '在线用户'
                            }
                        },
                        {
                            path: '/cacheList', component: cacheList, meta: {
                                title: '缓存列表'
                            }
                        },
                    ]
                },
            ]
        },




    ]
})

export default router
